<template>
  <div class="service-chat-main flex">
    <div class="chat-account-wrap">
      <ChatLeft />
    </div>
    <div class="chat-record-list">
      <ChatContent />
    </div>
    <div :class="['chat-search-record', warrper && 'hideRight']">
      <div
        v-if="warrper"
        class="rightbox commhover f-12 c_fff textcenter"
        @click="handleWrap(false)"
      >
        <i class="el-icon-search"></i>
        <span>搜索聊天记录</span>
      </div>
      <div
        v-else
        class="rightbox2 commhover f-12 c_fff textcenter"
        @click="handleWrap(true)"
      >
        <i class="el-icon-caret-right"></i>
      </div>
      <ChatRight />
    </div>
  </div>
</template>

<script>
import ChatContent from "./ChatRecord.vue";
import ChatLeft from './ChatLeft.vue'
import ChatRight from './ChatRight.vue'
export default {
  data() {
    return {
      warrper: false
    }
  },
  computed: {
  },
  components: {
    ChatLeft,
    ChatContent,
    ChatRight
  },
  methods: {
    handleWrap(val) {
      this.warrper = val;
    },
  },
};
</script>

<style lang="scss" scoped>
.service-chat-main {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-x: hidden;
  background: #fafafa;
  .chat-account-wrap {
    width: 280px;
    height: 100%;
  }
  .chat-record-list {
    flex: 1 1;
    height: 100%;
    position: relative;
    border-left: 1px solid #e9e9e9;
    border-right: 1px solid #e9e9e9;
  }
  .chat-search-record {
    width: 300px;
    height: 100%;
    position: relative;
    transition: all .8s;
    &.hideRight {
      width: 0;
      transition: all .8s;
      transform: translateX(100%);
      border-left: 1px solid #e9e9e9;
    }
    .rightbox {
      width: 22px;
      height: 140px;
      margin-top: -50px;
      padding-top: 5px;
      padding-left: 6px;
      line-height: 1.5;
      background: #7e8494;
      position: absolute;
      top: 50%;
      left: -25px;
      border-radius: 3px 0 0 3px;
      transition: all 0.5s;
    }
    .rightbox2 {
      position: absolute;
      top: 50%;
      left: -12px;
      margin-top: -12px;
      width: 12px;
      height: 50px;
      line-height: 50px;
      color: #fff;
      border-radius: 3px 0 0 3px;
      text-align: center;
      font-size: 12px;
      transition: all 0.5s;
      cursor: pointer;
      background: #6a6f7d;
    }
    .riline {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 4px;
      left: -4px;
      background: #7e8494;
      transition: all 0.5s;
    }
  }
}
</style>